package com.evil.enterprise.controller;

import com.evil.application.api.RemoteApplicationRobotLogService;
import com.evil.application.pojo.dto.robot.log.RobotLogReqDTO;
import com.evil.application.pojo.dto.robot.log.RobotLogRespDTO;
import com.evil.common.core.entity.PageModel;
import com.evil.common.core.entity.R;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 机器人日志接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/application/robot/log")
public class ApplicationRobotLogController {

    private final RemoteApplicationRobotLogService remoteApplicationRobotLogService;

    /**
     * 机器人日志分页
     *
     * @param pageModel pageModel
     * @return RobotLogRespDTO 分页列表
     */
    @PostMapping("/page")
    public R<PageInfo<RobotLogRespDTO>> robotLogPage(@Validated PageModel<RobotLogReqDTO> pageModel) {
        return R.success(remoteApplicationRobotLogService.robotLogPage(pageModel));
    }
}
